<script>
export default {
  name: "carouselComponent",
  data(){
    return{
      msg:'我是子组件',
      list:[1,2,3,4]
    }
  },
  methods:{
    toFather(){
      // this.$emit('getSon',this.list)
      this.$emit('getSon',JSON.stringify({a:this.list,b:this.msg}))
    }
  },
  created(){
    // this.$emit('getSon',this.msg)
  }
}
</script>

<template>
<!--  轮播图组件-->
<div class="swiper" @click="toFather">swiper</div>
</template>

<style scoped lang="less">
.swiper{
  width: 1200px;
  margin:  auto;
  height: 250px;
}
</style>